import {request} from '@/plugins/axios'

//分页查询 列表
export function getCostsPage(data, pageNum, pageSize) {
    return request({
        url: '/costs/page?pageNum='+pageNum+'&pageSize='+pageSize,
        method: 'post',
        data:data
    })
}

//新增
export function saveCostsApi(data,username) {
    return request({
        url: '/costs/saveCosts?username='+username,
        method: 'post',
        data:data
    })
}

//修改
export function updateCostsApi(data,username){
    return request({
        url:'/costs/updateCost?username='+username,
        method:'put',
        data:data
    })
}

//删除
export function deleteCostApi(id){
    return request({
        url:`/costs/deleteCost/${id}`,
        method:'delete'
    })
}

//获取各年的总成本
export function getCostsListApi(startY,endY){
    return request({
        url:'/costs/getCostsList?startY='+startY+'&endY='+endY,
        method:'get'
    })
}

//审核状态
export function updateCostStatusApi(data){
    return request({
        url:'/costs/updateCostStatus',
        method:'put',
        data:data
    })
}
//审核驳回原因
export function rejectCostApi(data){
    return request({
        url:'/costs/rejectCost',
        method:'put',
        data:data
    })
}
